-- Copyright (c) Huawei Technologies Co., Ltd. 2025. All rights reserved.
--
-- this file licensed under the Mulan PSL v2.
-- You can use this software according to the terms and conditions of the Mulan PSL v2.
-- You may obtain a copy of Mulan PSL v2 at: http://license.coscl.org.cn/MulanPSL2
--
-- THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
-- IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
-- PURPOSE.
-- See the Mulan PSL v2 for more details.
--
-- Author: auto generate
-- Create: 2025-10-30
-- Description: DO NOT EDIT; Code generated by "message.lua.mako"
local validate = require 'mc.validate'
local utils = require 'mc.utils'

local MFileSync = {}

---@class MFileSync.SyncType
---@field SyncType integer
local TSyncType = {}
TSyncType.__index = TSyncType
TSyncType.group = {}

local function TSyncType_from_obj(obj)
    return setmetatable(obj, TSyncType)
end

function TSyncType.new(SyncType)
    return TSyncType_from_obj({SyncType = SyncType or 1})
end
---@param obj MFileSync.SyncType
function TSyncType:init_from_obj(obj)
    self.SyncType = obj.SyncType or 1
end

function TSyncType:remove_error_props(errs, obj)
    utils.remove_obj_error_property(obj, errs, TSyncType.group)
end

TSyncType.from_obj = TSyncType_from_obj

TSyncType.proto_property = {'SyncType'}

TSyncType.default = {0}

TSyncType.struct = {{name = 'SyncType', is_array = false, struct = nil}}

function TSyncType:validate(prefix, errs, need_convert)
    prefix = prefix or ''

    validate.Optional(prefix .. 'SyncType', self.SyncType, 'uint8', false, errs, need_convert)

    TSyncType:remove_error_props(errs, self)
    validate.CheckUnknowProperty(self, TSyncType.proto_property, errs, need_convert)
    return self
end

function TSyncType:unpack(_)
    return self.SyncType
end

MFileSync.SyncType = TSyncType

---@class MFileSync.SyncInterval
---@field SyncInterval integer
local TSyncInterval = {}
TSyncInterval.__index = TSyncInterval
TSyncInterval.group = {}

local function TSyncInterval_from_obj(obj)
    return setmetatable(obj, TSyncInterval)
end

function TSyncInterval.new(SyncInterval)
    return TSyncInterval_from_obj({SyncInterval = SyncInterval or 5})
end
---@param obj MFileSync.SyncInterval
function TSyncInterval:init_from_obj(obj)
    self.SyncInterval = obj.SyncInterval or 5
end

function TSyncInterval:remove_error_props(errs, obj)
    utils.remove_obj_error_property(obj, errs, TSyncInterval.group)
end

TSyncInterval.from_obj = TSyncInterval_from_obj

TSyncInterval.proto_property = {'SyncInterval'}

TSyncInterval.default = {0}

TSyncInterval.struct = {{name = 'SyncInterval', is_array = false, struct = nil}}

function TSyncInterval:validate(prefix, errs, need_convert)
    prefix = prefix or ''

    validate.Optional(prefix .. 'SyncInterval', self.SyncInterval, 'uint8', false, errs, need_convert)

    TSyncInterval:remove_error_props(errs, self)
    validate.CheckUnknowProperty(self, TSyncInterval.proto_property, errs, need_convert)
    return self
end

function TSyncInterval:unpack(_)
    return self.SyncInterval
end

MFileSync.SyncInterval = TSyncInterval

---@class MFileSync.SyncMode
---@field SyncMode integer
local TSyncMode = {}
TSyncMode.__index = TSyncMode
TSyncMode.group = {}

local function TSyncMode_from_obj(obj)
    return setmetatable(obj, TSyncMode)
end

function TSyncMode.new(SyncMode)
    return TSyncMode_from_obj({SyncMode = SyncMode or 0})
end
---@param obj MFileSync.SyncMode
function TSyncMode:init_from_obj(obj)
    self.SyncMode = obj.SyncMode or 0
end

function TSyncMode:remove_error_props(errs, obj)
    utils.remove_obj_error_property(obj, errs, TSyncMode.group)
end

TSyncMode.from_obj = TSyncMode_from_obj

TSyncMode.proto_property = {'SyncMode'}

TSyncMode.default = {0}

TSyncMode.struct = {{name = 'SyncMode', is_array = false, struct = nil}}

function TSyncMode:validate(prefix, errs, need_convert)
    prefix = prefix or ''

    validate.Optional(prefix .. 'SyncMode', self.SyncMode, 'uint8', false, errs, need_convert)

    TSyncMode:remove_error_props(errs, self)
    validate.CheckUnknowProperty(self, TSyncMode.proto_property, errs, need_convert)
    return self
end

function TSyncMode:unpack(_)
    return self.SyncMode
end

MFileSync.SyncMode = TSyncMode

---@class MFileSync.SyncFileList
---@field SyncFileList string[]
local TSyncFileList = {}
TSyncFileList.__index = TSyncFileList
TSyncFileList.group = {}

local function TSyncFileList_from_obj(obj)
    return setmetatable(obj, TSyncFileList)
end

function TSyncFileList.new(SyncFileList)
    return TSyncFileList_from_obj({SyncFileList = SyncFileList or {}})
end
---@param obj MFileSync.SyncFileList
function TSyncFileList:init_from_obj(obj)
    self.SyncFileList = obj.SyncFileList or [=[]=]
end

function TSyncFileList:remove_error_props(errs, obj)
    utils.remove_obj_error_property(obj, errs, TSyncFileList.group)
end

TSyncFileList.from_obj = TSyncFileList_from_obj

TSyncFileList.proto_property = {'SyncFileList'}

TSyncFileList.default = {{}}

TSyncFileList.struct = {{name = 'SyncFileList', is_array = true, struct = nil}}

function TSyncFileList:validate(prefix, errs, need_convert)
    prefix = prefix or ''

    validate.OptionalArray(prefix .. 'SyncFileList', self.SyncFileList, 'string', false, errs, need_convert)

    TSyncFileList:remove_error_props(errs, self)
    validate.CheckUnknowProperty(self, TSyncFileList.proto_property, errs, need_convert)
    return self
end

function TSyncFileList:unpack(_)
    return self.SyncFileList
end

MFileSync.SyncFileList = TSyncFileList

return MFileSync
